-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[readState] tolerant short delay when read from contract staking indexer #4458
Conversation
if indexWithStart.StartHeight() >= height { | ||
return false, nil | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a startHeight
in delayTolerantIndexer
struct, and move this type assertion (and save its start height) when creating the instance one-time, so can directly use the value here:
if c.startHeight >= height {
return false, nil
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Quality Gate passedIssues Measures |
Description
Currently, the height of the indexer may briefly lag behind BlockDAO by 1, which can result in errors when querying the indexer.
To avoid this issue, we should increase a short waiting time when querying data from the indexer if we find that the height is behind.
In the specific implementation, we have introduced
delayTolerantIndexer
to implement this feature by wrapping the underlying indexer.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: